﻿{include file="Main/menu" /}
<form method="post">
	<div class="panel admin-panel" style="background: #fff">
		<div class="panel-head"><strong>{:lang('currency')['list']}</strong></div>
		<div class="padding border-bottom">
			<input type="button" class="button button-small checkall" name="checkall" checkfor="id" value="{:lang('currency')['all_select']}" onclick="Select_All()" />
			&nbsp;{:lang('label')['type']} :
			 <a type="button" class="{if input('get.type')=='image' || input('get.type')==''}bg-green text-white{/if} button button-small border-green" href="?type=image" />{:lang('currency')['image']}</a>
			 <a type="button" class="{if input('get.type')=='audio'}bg-green text-white{/if} button button-small border-green" href="?type=audio" />{:lang('currency')['audio']}</a>
			 <a type="button" class="{if input('get.type')=='video'}bg-green text-white{/if} button button-small border-green" href="?type=video" />{:lang('currency')['video']}</a>
			 <a type="button" class="{if input('get.type')=='other'}bg-green text-white{/if} button button-small border-green" href="?type=other" />{:lang('currency')['other']}</a>
			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{:lang('label')['handle']} :
				<a id="select_del" type="button" class="button button-small border-red" href="#" />{:lang('currency')['del']}</a>
			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span>{:lang('label')['size']} :</span>{$size/1024|sprintf='%.2f',###}Kb
		</div>
		<table class="table table-hover">
			<tr>
				<th width="100">{:lang('label')['select']}</th>
				{if $type=='image'}<th width="120">{:lang('label')['image']}</th>{/if}
				<th width="120">{:lang('label')['type']}</th>
				<th width="120">{:lang('label')['url']}</th>
				<th width="120">{:lang('label')['size']}</th>
				<th width="200">{:lang('label')['time']}</th>
			</tr>
			{volist name="data" id="volist"}
			<tr>
				<td >
					<input type="checkbox" name="box" value="{$volist.id}" />
				</td>
				{if $type=='image'}<td><img height="40" src="{$volist.url}"/></td>{/if}
				<td style="line-height:40px">{$volist.type}</td>
				<td style="line-height:40px">
					<a href="{$volist.url}">{$volist.url}</a>
				</td>
				<td style="line-height:40px">{$volist.size/1024|sprintf='%.2f',###}Kb</td>
				<td style="line-height:40px">{$volist.time|date="y-m-d",###}</td>
			</tr>
			{/volist}
		</table>
		{include file="public/pages" /}
	</div>
</form>
<script>
function Select_All() {
	var box = $("input[name='box']");
	for (var i in box){
		box[i].checked = !box[i].checked;
	}
}
$('#select_del').click(function(){
	var str="";
	$("input:checkbox[name='box']:checked").each(function(){
		str+=$(this).val()+",";
	});
	if(str!=''){
		if(confirm("{:lang('currency')['del']}?")){location.href='__URL/del.html?id='+str+'&type={:input("get.type")}&page={:input("get.page")}';}
	}
});
</script>
{include file="Main/menu_footer" /}